package com.software.levelupserver.controller;

import com.software.levelupserver.entity.Label;
import com.software.levelupserver.service.LabelService;
import com.software.levelupserver.utils.ResultVOUtil;
import com.software.levelupserver.vo.Result;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/label")
public class LabelController {
    @Resource
    private LabelService labelService;

    /**
     * 获取当前所有label
     * @return
     */
    @GetMapping("/getAllLabels")
    public Result getAllLabels(){
        List<Label> AllLabels = labelService.selectAllLabels();

        return ResultVOUtil.success(AllLabels);
    }
}
